package com.vickw.springcloud.service;

import com.vickw.springcloud.entity.CommonResult;
import com.vickw.springcloud.entity.Payment;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@Component  //别忘了添加这个
@FeignClient(value = "CLOUD-PROVIDER-PAYMENT")  //服务名称，要和eureka上面的一致才行
public interface PaymentFeignService {
    //这个就是provider 的controller层的方法定义。
    @GetMapping(value = "/payment/get/{id}")
    CommonResult<Payment> getPaymentById(@PathVariable("id") Long id);

    @GetMapping(value = "payment/feign/timeout")
    String paymentFeignTimeout();
}
